<?php
class M_sekolah extends Nvl_Model{
	function __construct(){
		parent::__construct();
		$this->table_name='m_sekolah';
		$this->column_primary='sekolah_id';
		$this->column_order='';
		$this->column_unique='sekolah_nama';
		$this->column_active='sekolah_aktif';
	}
	
	function get_list($start, $end, $search_text){
		if($search_text != ''){
			$this->db->like('sekolah_nama', $search_text);
		}
		if($start != 0 && $end != 0){
			$this->db->limit($end, $start);
		}
		$record = $this->db->get('m_sekolah');
		$final[] = array(
			"total"=>$record->num_rows(),
			"results"=>$record->result()
		);
		return json_encode($final);
	}
}